<template>
  <div class="homePage">
    <div class="logo">
      <img :src="logo" class="" />
    </div>
    <div class="header">
        <img :src="logo2" />
        <p >YooMatch</p>
</div>
    <div class="buttons">
        <div class="buttonBase left" @click="downLoadApp('google_play')">
            <img :src="Google" class="" />
            <p>Google Paly</p>
        </div>
        <div class="buttonBase right" @click="downLoadApp('apple_store')">
            <img :src="image_apple" class="" />
            <p>App Store</p>
        </div>
    </div>
    <div class="protocol">
      YooMatch 2024. All rights reserved.
      <RouterLink :to="{ name: 'termsOfUse' }">
        <a href="#">Terms of Use</a>
      </RouterLink>
      /
      <RouterLink :to="{ name: 'privacyPolicy' }">
        <a href="#">Privacy Notice</a>
      </RouterLink>
      Help Center: YooMatch.help@gmai.com
    </div>
    
  </div>
</template>

<script setup lang="ts">
import logo from "@/views/home/imgs/image_logo.png";
import Google from "@/views/home/imgs/Google.png";
import image_apple from "@/views/home/imgs/image_apple.png";
import logo2 from "@/views/home/imgs/LOGO2.png"
import api from "@/api/api";
import { useI18n } from "vue-i18n";
const { t, locale } = useI18n();
import { useAutoRequest } from "@/hooks/loading";
const router = useRouter();
const [loading ,home] = useAutoRequest(api.home)
const stroe = ref({
    apple_store: '',
    google_play: '',
})
const getData = async()=> {
    const data = await home({})
    console.log(data)
    stroe.value = {
        ...data
    }
}
onMounted(()=> {
    getData()
})

const downLoadApp = (type:keyof typeof stroe.value)=> {
    window.open(stroe.value[type])
}
</script>

<style scoped lang="scss">
.homePage {
  width: 100vw;
  height: 100vh;
  background-image: url("@/views/home/imgs/image_beij.png");
  background-size: cover;
  background-repeat: no-repeat;
  overflow: hidden;
  position: relative;
}
.logo {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 20vh;
  img {
    width: 120px;
  }
}
.protocol {
    font-size: 8px;
    text-align: center;
    position: fixed;
    bottom: 2vh;
}
.buttons {
    position: fixed;
    bottom: 16vh;
    display: flex;
    align-items: center;
    justify-content: space-around;
    width: 100%;
    img {
        width: 15px;
    }
    .buttonBase {
        text-align: center;
        padding: 2px 0;
        width: 32vw;
        background: #fff;
        border-radius: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        p {
            font-weight: bold;
            font-size: 9px;
            margin-left: 5px;
        }
    }
}
.header {
    position: fixed;
    top: 2vh;
    left: 10vw;
    display: flex;
    align-items: center;
    p {
        color: #fff;
        margin-left: 5px;
        font-size: 12px;
    }
    img {
        width: 18px;
    }
}
@media (max-width: 768px) {
  /* 针对移动端的样式 */
  .homePage {
    background-image: url("@/views/home/imgs/h5.png");
  }
  .protocol {
    font-size: 12px;
  }
  .logo {
    img {
        width: 240px;
    }
  }
  .header {
    p {
        font-size: 20px;
    }
    img {
        width: 30px;
    }
  }
  .buttons {
    flex-direction: column;
    .buttonBase {
        padding: 10px 0;
      width: 65vw;
      margin-bottom: 25px;
      p {
        font-size: 14px;
      }
    }
  }
}
</style>
